package com.whfc.fmam.entity.dto;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.util.List;
import java.util.Objects;

/**
 * @author : qzexing
 * @version : 1.0
 * @date : 2020/6/1 11:17
 */
@Getter
@Setter
public class FmamWeighNoteAnalysisDTO implements Serializable {

    /**
     * 材料类型ID
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long matTypeId;
    /**
     * 父ID
     */
    private Long pid;
    /**
     * 材料类型名称
     */
    private String matTypeName;
    /**
     * 材料ID
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long matId;
    /**
     * 材料名称
     */
    private String matName;
    /**
     * 材料类型编码
     */
    private String fullCode;
    /**
     * 运单重量
     */
    private Double deliveryWeight;
    /**
     * 实际重量
     */
    private Double actualWeight;
    /**
     * 子节点
     */
    private List<FmamWeighNoteAnalysisDTO> children;


    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        FmamWeighNoteAnalysisDTO that = (FmamWeighNoteAnalysisDTO) o;
        return Objects.equals(matTypeId, that.matTypeId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(matTypeId);
    }
}
